<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="${ctxStatic}/layui-v2.5.6/layui/css/layui.css">
<!--    <link type="text/css" rel="stylesheet" href="layui/css/layui.css" />
   -->
  <script type="text/javascript" src="${ctxStatic}/layui-v2.5.6/layui/layui.js"></script>
  
 </head>
<body>

<div style="margin: 10px;">

   
	<form class="layui-form layui-form-pane" lay-filter="example">
	
	<div class="layui-form-item">
	 	 <input type="hidden" name="id">
	 </div> 
	 <div class="layui-form-item">
	    <label class="layui-form-label">公司名称：</label>
	   
		    <div class="layui-input-inline">
		      <input type="text" name=companyName id="companyName" autocomplete="off" class="layui-input">
		    </div> 
	    <label class="layui-form-label">车牌号：</label>
		    <div class="layui-input-inline">
		      <input type="text" name="vehicleNo" id="vehicleNo" autocomplete="off" class="layui-input">
		    </div>
	 </div>
	 
	  <div class="layui-form-item">
	   
	      <label class="layui-form-label">车牌颜色:</label>
		    <div class="layui-input-inline">
		      <input type="text" name="color" id="color" autocomplete="off" class="layui-input">
		    </div>
	     <label class="layui-form-label">从业资格证:</label>
		    <div class="layui-input-inline">
		      <input type="text" name="qualificationCertificate" id="qualificationCertificate" autocomplete="off" class="layui-input">
		    </div>
	  </div> 
	  <div class="layui-form-item">
	    <label class="layui-form-label">发证机构:</label>
	  
	      <div class="layui-input-inline">
	      <input type="text" name="issuingAuthority" id="issuingAuthority" autocomplete="off" class="layui-input">
	    </div>
	    <label class="layui-form-label">司机名称：</label>
			    <div class="layui-input-inline">
			       <input type="text" name="name" id="name" autocomplete="off" class="layui-input"> 
			      <!--  <input type="text" class="layui-input" name="timeDate" id="timeDate" placeholder="yyyy-MM-dd HH:mm:ss"> -->
			    </div> 
	      <label class="layui-form-label">身份证号码:</label>
			    <div class="layui-input-inline">
			      <input type="text" name="idCard" id="idCard" autocomplete="off" class="layui-input"> 
			      <!--  <input type="text" class="oveTimeDate" name="oveTimeDate" id="timeDate" placeholder="yyyy-MM-dd HH:mm:ss"> -->
			    </div> 
	  </div> 
	   
	
	  <div class="layui-form-item">
	    <label class="layui-form-label"> 入职时间:</label>
		    <div class="layui-input-inline">
		      <input type="text" name="entryTime" id="entryTime" autocomplete="off" class="layui-input">
		    </div>
	    <!--  <label class="layui-form-label">创建者:</label>
		    <div class="layui-input-inline">
		      <input type="text" name="createBy" id="createBy" autocomplete="off" class="layui-input">
		    </div>  -->
	  </div>
	  <div class="layui-form-item layui-form-text"><!-- <div class="layui-form-item"> -->
	    <label class="layui-form-label">备注:</label>
		    <div class="layui-input-block">
		      <textarea name="remarks" placeholder="请输入内容" class="layui-textarea"></textarea>
		    </div>
	  <!-- <div class="layui-form-item">
	    <label class="layui-form-label">创建时间：</label>
		    <div class="layui-input-inline">
		      <input type="text" name="createdate" id="createdate" autocomplete="off" class="layui-input">
		    </div>  
	    <label class="layui-form-label">更新者：</label>
		    <div class="layui-input-inline">
		      <input type="text" name="updateby" id="updateby" autocomplete="off" class="layui-input">
		    </div>
	   </div>  -->
	  
	<!--   <div class="layui-form-item">
	    <label class="layui-form-label">更新时间：</label>
		    <div class="layui-input-inline">
		      <input type="text" name="updateDate" id="updateDate" autocomplete="off" class="layui-input">
		    </div>
	  </div>   -->
	<!--   <div class="layui-form-item">
	    <label class="layui-form-label">备注：</label>
		    <div class="layui-input-inline">
		      <input type="text" name="remarks" id="remarks" autocomplete="off" class="layui-input">
		    </div>
	  </div> -->
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" id="submitBtn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
	</form>
</div>
	 
  
<script>

layui.use(['form', 'laydate'], function(){
	var form = layui.form;
	var laydate = layui.laydate;
	var $ = layui.$;
	
	
	//日期
	 laydate.render({
	   elem: '#entryTime',
	   trigger: 'click', //采用click弹出
	   value: new Date()
	});  
	/*  laydate.render({
		   elem: '#oveTimeDate',
		   trigger: 'click', //采用click弹出
		   value: new Date()
		});   */
	
	
	//表单赋值
	form.val('example', {		
			"id": "${securityDriver.id}"
					,"companyName":"${securityDriver.companyName}"
		 		 	,"officeId": "${securityDriver.office.id}" 
			       ,"vehicleNo": "${securityDriver.vehicleNo}"
			       ,"color":"${securityDriver.color}"
			       ,"qualificationCertificate": "${securityDriver.qualificationCertificate}"
			       ,"issuingAuthority": "${securityDriver.issuingAuthority}"
		    	   ,"name": "${securityDriver.name}"
		    	   ,"idCard": "${securityDriver.idCard}"
			       ,"entryTime": "${securityDriver.entryTime}"
				   ,"createBy": "${securityDriver.createBy}"
				   ,"createDate": "${securityDriver.createDate}"   /* ,"timeDate": "${seniorAssets.timeDate}" */
				   ,"updateBy": "${securityDriver.updateBy}"
				   ,"updateDate": "${securityDriver.updateDate}"
				   ,"remarks": "${securityDriver.remarks}"
				  
	          
 });
	//监听提交
	 form.on('submit(formDemo)', function(data){
		$('#submitBtn').addClass("layui-btn-disabled").attr("disabled",true);
		var aa = JSON.stringify(data.field);
		$.ajax({
            url: "${ctx}/jx/securityDriver/save",
            type: "POST",
            dataType: "json",
            data: {
            	dataString : aa
            },
            async: false,
            success: function(data){
                layer.msg(data,{time:1*500},function(){
                    var iframe_index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(iframe_index); //再执行关闭      
                    parent.layui.table.reload('thisReloadId');
                });
            },
            error: function(){
            	layer.msg('保存失败', {icon: 2});
            	$('#submitBtn').removeClass("layui-btn-disabled").attr("disabled",false);
            }
        });
		return false;
	}); 
	
	
	

	
	
	
	
}); 
</script>
  

</body> 
</html>
